<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .one{
            width: 200px;
            height: 200px;
            background-color: pink;
        }
        .two{
            width: 300px;
            height: 300px;
            background-color: blue;
        }
        .three{
            width: 400px;
            height: 400px;
            background-color: orange;
        }
    </style>
</head>
<body>
    <div></div>
    <div></div>
    <div></div>
    <script>
        // 需求: 把类名用js方式, 分发给对应div显示
        // 1. 类名数组
        let classArr = ['one', 'two', 'three']
        // 2. 获取div
        let divList = document.querySelectorAll('div') // NodeList [div, div, div]
        // 3. 遍历伪数组, 拿出每个div标签对象
        for (let i = 0; i < divList.length; i++) {
            divList[i].className = classArr[i]
        }
    </script>
</body>
</html>